package com.itheima.security;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/security")
public class MyController {

    @RequestMapping("/add")
    @PreAuthorize("hasAuthority('新增检查项')")
    public String add(){
        return "add";
    }

    @RequestMapping("/query")
    @PreAuthorize("hasAuthority('查询检查项')")
    public String query(){
        return "query";
    }

    @RequestMapping("/hushi")
    @PreAuthorize("hasRole('ROLE_护士')")
    public String huShi(){
        return "huShi";
    }
}
